package com.itheima.utils;

import lombok.RequiredArgsConstructor;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.util.StringUtils;

import java.util.HashMap;

import static org.junit.jupiter.api.Assertions.*;

@SpringBootTest
class JwtUtilsTest2 {

    @Autowired
    private JwtUtils jwtUtils;

    @Test
    public void test() {
        HashMap<String, Object> map = new HashMap<>();
        map.put("userId", 1);
        map.put("username", "zhangsan");
        String jwt = jwtUtils.createJWT(map);
        System.out.println(jwt);
    }

    @Test
    public void test3() {
        String token = "token";
        System.out.println(StringUtils.hasLength(token));
    }
}